<?php
/** .-------------------------------------------------------------------
* |    Author: 熊伟洋 <chelious@foxmail.com>
* |    WeChat: hello_McGrady
* |    	   QQ: 434493420
* |     Motto: Hungry & Humble
* |---------------------------------------------------------------------
* |    Copyright (c) 2012-2020, www.chelious.com. All Rights Reserved.
* '-------------------------------------------------------------------*/

namespace app\admin\controller;

class Webset extends Common {

    private $webModel;

    public function __construct()
    {
        $this->webModel = new \system\model\Webset();
        parent::__construct();
    }

    public function index(){
        $data = Db::table('webset')->get();
        View::with('data',$data);
        if(IS_POST){
            $webData = $_POST;
            foreach ($webData as $k => $v){
//                p($k);
//                p($v);
                $this->webModel->where('name',$k)->update(['value'=>$v]);
            }
            message('修改成功',u('admin.webset.index'),'success');
        }

        return view();
    }

}
